<template>
  <div class="promotion-details">
    <Header></Header>
    <div class="content">
        <h3>{{this.detailsList.title}}</h3>
        <p>{{this.detailsList.created_at}}</p>
        <span></span>
        <div v-html="detailsList.body"></div>
    </div>
     <div class="fixeds" v-show="topShow" ref="viewBox">
            <a href="#">
                <img src="../../../static/img/back-top.png" alt="">
            </a>
     </div>
    <Interactive></Interactive>
  </div>
</template>
<script>
import Header from '../productVideo/components/Header'
import Interactive from '../interactive/Interactive'
export default {
  name: 'SafetyPromotionDetails',
  data(){
      return {
          detailsList: [],
          id: null,
          topShow: true
      }
  },
  components: {
      Header,
      Interactive
  },
  methods: {
      getId(){
          this.id = this.$route.params.id
      }
  },
  created(){
      this.getId();
      this.axios.get('/articles/'+ this.id,{
          params: {
              id: this.id
          }
      })
      .then((res) => {
          this.detailsList = res.data.data;
          console.log(res.data.data);
      })
      .catch((error) => {
          console.log(error);
      })
  }
}
</script>
<style scoped>
.promotion-details{
    width: 100%;
    height: auto;
}
.promotion-details .content{
    margin-top: .4rem;
    width: 6.7rem;
    height: auto;
    margin-left: .4rem;
}
.promotion-details .content h3{
    font-size: 16px;
    color: #333;
    width: 100%;
    text-align: center;
    height: .4rem;
    overflow: hidden;
}
.promotion-details .content p{
    width: 100%;
    text-align: center;
    margin-top: .2rem;
    font-size: 12px;
    color: #ccc;
}
.promotion-details .content span{
    width: 100%;
    border-bottom: .02rem solid #e8e8e8;
    display: inline-block;
    margin-top: .2rem;
}
.promotion-details .content div{
    margin-top: .2rem;
    font-size: 14px;
    margin-bottom: 1.5rem
}

.promotion-details .content div img{
    width: 100%;
    height: auto;
}

.promotion-details  .fixeds{
    width: .7rem;
    height: .7rem;
    position: fixed;
    bottom: 2.5rem;
    right: .3rem;
}
.promotion-details  .fixeds img{
    width: 100%;
    height: auto;
}
</style>
<style>
.promotion-details .content div img{
    max-width: 100%;
    height: auto;
}
</style>
